package ocean.chinacraft.common.entity.fly;

import net.minecraft.entity.EntityType;
import net.minecraft.entity.FlyingEntity;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.ai.attributes.AttributeModifierMap;
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.world.World;
import ocean.chinacraft.common.entity.fly.control.FlyingControl;
import ocean.chinacraft.common.entity.goal.fly.FlyingRandomGoal;

/**
 * 孔明灯Entity
 *
 * @author zhang
 */
public class SkyLanternEntity extends FlyingEntity {

    public SkyLanternEntity(EntityType<? extends SkyLanternEntity> entityType, World world) {
        super(entityType, world);
        moveControl = new FlyingControl<>(this);
    }

    public static AttributeModifierMap.MutableAttribute createAttributes() {
        return MobEntity.createMobAttributes().add(Attributes.MAX_HEALTH, 30D);
    }

    @Override
    protected void registerGoals() {
        this.goalSelector.addGoal(5, new FlyingRandomGoal<>(this));
    }
}
